//
//  Nove.m
//  shusheng
//
//  Created by rimi on 16/7/13.
//  Copyright © 2016年 yuying. All rights reserved.
//

#import "Nove.h"

@implementation Nove
- (void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:self.name forKey:@"name"];
    [aCoder encodeObject:self.synopsis forKey:@"synopsis"];
    [aCoder encodeObject:self.time forKey:@"time"];
    [aCoder encodeObject:self.pic forKey:@"pic"];
}
//解压操作
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder{
    
    self = [super init];
    if (self) {
        self.name = [aDecoder decodeObjectForKey:@"name"];
        self.synopsis = [aDecoder decodeObjectForKey:@"synopsis"];
        self.time = [aDecoder decodeObjectForKey:@"time"];
        self.pic = [aDecoder decodeObjectForKey:@"pic"];
    }
    return self;
}


//重写打印方法~
- (NSString *)description
{
    NSDictionary * info = @{@"name":self.name,@"synopsis":self.synopsis,@"time":self.time,@"pic":self.pic};
    return [NSString stringWithFormat:@"<%@:%p,%@>", [self class],self,info];
}


@end
